#include <iostream>
using namespace std;

/*
	指向类成员的指针
*/
class Cdate
{
public:
	Cdate()
	{
		year=0;
		month=0;
		day=0;
	}
	void disp()
	{
		cout<<day<<"-"<<month<<"-"<<year<<endl;
	}
	void setDate(int y,int m,int d)
	{
		year=y;
		month=m;
		day=d;
	}
	void plusTwo()
	{
		//4,6,9,11四个月是30天，2月特殊
		if(month==4 || month==6 || month==9 || month==11)
		{
			if(day>28)
			{
				month+=1;
				day=day+2-30;
			}
			else
				day+=2;
		}
		else if(month==2) 
		{
			if((year%4==0&&year%100!=0) || (year%400==0)) //闰年
			{
				if(day>27)
				{
					month+=1;
					day=day+2-29;
				}
				else
					day+=2;
			}
			else //平年
			{
				if(day>26)
				{
					month+=1;
					day=day+2-28;
				}
				else
					day+=2;
			}
		}
		else 
		{
			if(day>29)
			{
				if(month==12)
				{
					year+=1;
					month=1;
					day=day+2-31;
				}
				else
				{
					month+=1;
					day=day+2-31;
				}			
			}
			else
				day+=2;
		}
	}
private:
	int year;
	int month;
	int day;
};

int main()
{
	Cdate c1;
	c1.setDate(2023,12,30);
	c1.plusTwo();
	c1.disp();
}